<?php namespace Phpcmf\Controllers;

class Zhe extends \Phpcmf\Home\Module {

    public function index() {

        $this->_module_init();

        $pre = \Phpcmf\Service::M()->dbprefix(SITE_ID.'_store');
        $sql = 'select c.*,b.stime,b.etime,b.type as ptype,b.title as pname from `'.$pre.'_goods_promotion_item` as `a` left join `'.$pre.'_goods_promotion` as `b` on a.pid=b.id left join `'.$pre.'` as `c` on a.cid=c.id where b.status=1 and c.is_sale=1 and (b.stime < '.SYS_TIME.' and b.etime > '.SYS_TIME.') order by c.updatetime';

        \Phpcmf\Service::V()->assign([
            'markid' => 'zhekou',
            'urlrule' => '/index.php?s=store&c=zhe&page=[page]',
            'query_sql' => urlencode($sql),
            'meta_title' => $this->mall_info['promotion_page']['title'],
            'meta_keywords' => $this->mall_info['promotion_page']['keywords'],
            'meta_description' => $this->mall_info['promotion_page']['description'],
        ]);
        \Phpcmf\Service::V()->display('zhekou.html');
    }

}
